<!-- Inicio Codigo feo para FB-->
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/es_LA/all.js#xfbml=1&appId=151090545023142";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<%# ruta_root = "http://pukara.ya.st"%>
<% ruta_root = "http://200.16.7.111"%>
<% ruta = ruta_root+'/cultural_heritage/tipologies/'+@cultural_heritage_tipology.id.to_s %>
<% titulo= '<meta property="og:title" content="[Pukara] '+@cultural_heritage_tipology.name+'" >'%>
<%=  content_for(:title) {
  titulo.html_safe
  } %>
<% url= '<meta property="og:url" content="'+ruta+'">'%>
<%=  content_for(:url) {
  url.html_safe
} %>
<%=  content_for(:type) {
  '<meta property="og:type" content="article">'.html_safe
} %>
<%imagen = '<meta property="og:image" content="'+ruta_root+'/images/pukara_logo2.png">'%>
<%=  content_for(:image) {
  imagen.html_safe
} %>
<%=  content_for(:site_map) {
  '<meta property="og:site_name" content="Pukara">'.html_safe
} %>
<!-- Fin Codigo feo para FB-->
<h1>Mostrar Tipología <%= @cultural_heritage_tipology.name %></h1>
<p id="notice"><%= notice %></p>
<div clas="shadow">
<fieldset  class="column-left4">
  <fieldset id="agrupacion" >
  <legend>Datos Básicos </legend>
  <p>
    <b>Nombre:</b>
    <%= @cultural_heritage_tipology.name %>
  </p>
  <p>    
    <b>Grupo:</b>
    <%= link_to @cultural_heritage_tipology.str_group,{:controller=>"/cultural_heritage/groups",:action => 'show',:id => @cultural_heritage_tipology.group} %>
    <%#= @cultural_heritage_tipology.str_group %>
  </p>

  <p>
    <b>Subgrupo:</b>
    <%#= @cultural_heritage_tipology.str_subGroup %>
    <%= link_to @cultural_heritage_tipology.str_subGroup,{:controller=>"/cultural_heritage/sub_groups",:action => 'show',:id => @cultural_heritage_tipology.subGroup} %>
  </p>
  <% if ! @cultural_heritage_tipology.description.blank? %>
  <p>
    <b>Descripción:</b>
    <%= @cultural_heritage_tipology.description %>
  </p>
  <%end%>
  </fieldset>
</fieldset>
  <fieldset class="column-right4">
    <fieldset id="agrupacion" width="200">
      <legend>Compartir</legend>
      <div class="fb-like" data-href="<%=ruta%>" data-send="false" data-layout="box_count" data-width="50" data-show-faces="false"></div>
      <br/><br/>
      <% l_url = litle_url(ruta)%>
      <a href="https://twitter.com/share" class="twitter-share-button" data-url="<%= l_url  %>" data-text="Sistema de Gestion de la Cultura Peruana Pukara" data-lang="es" data-hashtags="Pukara">Twittear</a>
      <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
      <br/><br/>
      <!-- Place this tag where you want the +1 button to render -->
      <g:plusone size="small"></g:plusone>
      <!-- Place this render call where appropriate -->
      <script type="text/javascript">
      window.___gcfg = {lang: 'es-419'};

      (function() {
        var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
        po.src = 'https://apis.google.com/js/plusone.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
      })();
      </script>
    </fieldset>
  </fieldset>
  <div id="lineaform"></div>
  <fieldset id="agrupacion" >
    <legend>Patrimonios por Tipología </legend>
    <% if !(@cultural_heritage_tipology.list_cultural_heritages.blank?) %>
    <table class="paginated_table sorted_table" >
      <thead>
      <tr>
        <th>Nombre</th>
        <th>Grupo</th>
        <th>Sub Grupo</th>
      </tr>
    </thead>
    <tbody>
    <% @cultural_heritage_tipology.list_cultural_heritages.each do |cultural_heritage| %>
      <tr>
        <td>
          <%if cultural_heritage.group == 1%>
           <%= link_to cultural_heritage.name_code,{:controller=>"/cultural_heritage/cultural_heritages",:action => 'show',:id => cultural_heritage.id},:title => cultural_heritage.description %>
          <%else%>
           <%= link_to cultural_heritage.name_code,{:controller=>"/cultural_heritage/cultural_heritage_properties",:action => 'show',:id => cultural_heritage.id},:title => cultural_heritage.description %>
          <%end%>
        </td>
        <td><%= cultural_heritage.obj_group.name %></td>
        <td><%= cultural_heritage.obj_subGroup.name %></td>
      </tr>
    <% end %>
    </tbody>
    </table>
    <% else %>
        <p> Ningún registro encontrado</p>
    <% end %>
  </fieldset>
<div id="lineaform"></div>
<!-- Facebook Inicia aqui -->
<div class="fb-comments" data-href="<%=ruta%>" data-num-posts="4" data-width="470"></div>
<div id="lineaform"></div>
</div>
<br/>
<% if (user_signed_in? && ([2].include?(current_user.role))) %>
<%= link_to 'Editar', edit_cultural_heritage_tipology_path(@cultural_heritage_tipology) %> |
<%end%>
<%= link_to 'Regresar', cultural_heritage_tipologies_path %>
